package com.zsp.coupon.feign;


import com.zsp.coupon.exception.CouponException;
import com.zsp.coupon.feign.hystrix.SettlementClientHystrix;
import com.zsp.coupon.vo.CommonResponse;
import com.zsp.coupon.vo.SettlementInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * 优惠卷结算微服务 Fegine接口定义
 */
@FeignClient(value = "eureka-client-coupon-settlement",
                fallback = SettlementClientHystrix.class)
public interface SettlementClient {
    /**
     * 优惠卷规则计算
     */
    @RequestMapping(value = "/coupon-settlement/settlement/compute",
            method = RequestMethod.POST)
    CommonResponse<SettlementInfo> computeRule(SettlementInfo settlement) throws CouponException;
}
